<template>
  <div class="tabs-wrap" :style="{ justifyContent: justifyContent }">
    <div
      v-for="(tab, index) in tabList"
      :key="'tab' + index"
      @click="selectTab(tab, index)"
      class="tabs-item"
      :class="{
        active: index === selectedIndx,
        firstClass: tab.value === '5',
      }"
    >
      {{ tab.name }}
    </div>
  </div>
</template>
<script>
export default {
  props: {
    tabList: Array,
    selectedIndx: {
      type: Number,
      default: 0,
    },
    justifyContent: {
      type: String,
      default: '',
    }
  },
  data() {
    return {};
  },
  mounted() {},
  methods: {
    // tab切换
    selectTab(tab, index) {
      this.$emit('selectTab', { tab, index });
    },
  },
};
</script>
